import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
// import activityMgmRouter from '@/router/module/activityMgm'
// import bannerMgmRouter from '@/router/module/bannerMgm'
// import basicInformationMgmRouter from '@/router/module/basicInformationMgm'
// import fishingPositionMgmRouter from '@/router/module/fishingPositionMgm'
// import memberMgmRouter from '@/router/module/memberMgm'
// import passengerFlowMgmRouter from '@/router/module/passengerFlowMgm'
// import trafficFlowMgmRouter from '@/router/module/trafficFlowMgm'
// import systemMgmRouter from '@/router/module/systemMgm'
// import weightMgmRouter from '@/router/module/weightMgm'

import workbench from '@/router/module/workbench'
import iotMonitoring from '@/router/module/iotMonitoring'
import monitoringAlarmManagement from '@/router/module/monitoringAlarmManagement'
import batchManagment from '@/router/module/batchManagment'
import pondManagment from '@/router/module/pondManagment'
import jobManagment from '@/router/module/jobManagment'
import transferPondManagment from '@/router/module/transferPondManagment'
import healthManagement from '@/router/module/healthManagement'
import diseaseBankManagement from '@/router/module/diseaseBankManagement'
import inspectionManagement from '@/router/module/inspectionManagement'
import pondPatrolManagement from '@/router/module/pondPatrolManagement'
import outputManagment from '@/router/module/outputManagment'
import pondClearingManagment from '@/router/module/pondClearingManagment'
import inputManagment from '@/router/module/inputManagment'
import basicInformation from '@/router/module/basicInformation'
import earlyWarningConfiguration from '@/router/module/earlyWarningConfiguration'
import cropModel from '@/router/module/cropModel'
import systemNotificationManagement from '@/router/module/systemNotificationManagement'


//运营
import storageManagement from '@/router/module/storageManagement'
import energyManagement from '@/router/module/energyManagement'
import facilityManagement from '@/router/module/facilityManagement'
import basicInformationOperate from '@/router/module/basicInformationOperate'
import assessManagement from '@/router/module/assessManagement'
import purchaseManage from '@/router/module/purchaseManage'
import saleManagement from '@/router/module/saleManagement'
import systemSettings from '@/router/module/systemSettings'



const constantRoutes_sc = [
  workbench,	//	工作台,
  iotMonitoring,	//	物联监控,
  monitoringAlarmManagement,//物联告警管理
  batchManagment,	//	批量管理,
  pondManagment,	//	投塘管理,
  jobManagment,	//	作业管理,
  transferPondManagment,	//	转塘管理,
  healthManagement,	//	健康管理,
  inspectionManagement,	//	检验管理,
  assessManagement,	//	评估管理,
  outputManagment,	//	产出管理,
  pondClearingManagment,	//	清塘管理,
  inputManagment,	//	投入品管理,
  cropModel,
  diseaseBankManagement,	//	疾病管理,
  earlyWarningConfiguration,//预警配置
  systemNotificationManagement,//通知配置
  basicInformation	//	生产基本信息
]
//运营
const constantRoutes_yy = [
  facilityManagement, //设施管理
  energyManagement,//能源管理
  storageManagement,  //仓储管理
  purchaseManage,//采购管理
  saleManagement,//销售管理
  pondPatrolManagement,	//	巡查管理,
  basicInformationOperate,//人员管理
  systemSettings,//系统配置管理
]

export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/chooseSystem',
    component: () => import('@/views/chooseSystem/index'),
    hidden: true
  },
  ...constantRoutes_sc,
  ...constantRoutes_yy,
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  { path: '*', redirect: '/404', hidden: true }
]

const createRouter = () => new Router({
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
